package com.Class;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.concurrent.TimeUnit;

public class MainApp {
    public static void main(String[] args) {
        ClassB classB = new ClassB();
        System.out.println(classB.getClass());
        Type typeA = classB.getClass().getGenericSuperclass();
        System.out.println(typeA);
        Type[] type_fanxing = ((ParameterizedType)typeA).getActualTypeArguments();
        System.out.println(type_fanxing[0]);
        System.out.println(type_fanxing[1]);


        Cache<String,String> cacher = CacheBuilder.newBuilder().maximumSize(1000L).expireAfterWrite(20000, TimeUnit.MINUTES).build();
        cacher.put("test:1","test23123");


        String value = cacher.getIfPresent("test:1");
        System.out.println(value);

    }
}
